package Base.StaticTest;

public class StaticTest {
    public static void main(String[] args) {
        Chinese fen = new Chinese();
        fen.name = "枫城";
        fen.age = 22;
        Chinese.nation = "CN";
        System.out.println(fen);
        // Chinese{name='枫城', age=22, nation=CN}
        // Chinese{name='晚风', age=22, nation=CN}

        Chinese wan = new Chinese();
        wan.name = "晚风";
        wan.age = 22;
        wan.nation = "Chine";
        System.out.println(fen);
        System.out.println(wan);
        // Chinese{name='枫城', age=22, nation=Chine}
        // Chinese{name='晚风', age=22, nation=Chine}

        Chinese.show(); // Show the name: name

    }
}

class Chinese{
    String name;
    int age;
    // 静态属性
    static String nation;

    @Override
    public String toString() {
        return "Chinese{" +
                "name='" + name + '\'' +
                ", age=" + age  + ", nation=" + nation +
                '}';
    }

    public static void show(){
        System.out.println("Show the name: name");
    }
}
